package checkers;

public class CheckersOperation {

    public static final byte SOURCE_POSITION = 1;
    public static final byte TARGET_POSITION = 2;
    public static final byte REMOVE_PIECE = 3;
    public static final byte BECOME_KING = 4;
    public byte x, y, operation;

    public CheckersOperation(byte x, byte y, byte operation) {
        this.x = x;
        this.y = y;
        this.operation = operation;
    }

    public CheckersOperation(int x, int y, byte operation) {
        this.x = (byte) x;
        this.y = (byte) y;
        this.operation = operation;
    }

    public boolean equals(CheckersOperation target) {
        if (this.x == target.x
                && this.y == target.y
                && this.operation == target.operation) {
            return true;
        }
        return false;
    }

    public boolean equalsPosition(byte x, byte y) {
        if (this.x == x && this.y == y) {
            return true;
        }
        return false;
    }

    public CheckersOperation clone() {
        return new CheckersOperation(this.x, this.y, this.operation);
    }
}
